from Spider import Spider
from RequestItem import RequestItem

if __name__ == '__main__':
    headers = {'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.114 Safari/537.36'}
    request_items = []

    for i in range(1, 10):
        request_items.append(RequestItem(url='https://api.weibotop.cn/getclosesttime', params={'timestamp': '2020-10-0{0}T12:00:00'.format(i)}, timeout=3000))

    spider = Spider(request_items, thread_num=5, headers_list=[headers], sleep_time=0.5)
    spider.run()

# See PyCharm help at https://www.jetbrains.com/help/pycharm/
